package com.example.demo.netty.基于Netty实现RPC框架.客户端代理;

import org.springframework.cglib.proxy.Proxy;

public class ProxyFactory {
    public static <T> T create(Class<T> interfaceClass) throws Exception {
        return (T) Proxy.newProxyInstance(interfaceClass.getClassLoader(),new Class<?>[] {interfaceClass}, new RpcClientDynamicProxy<T>(interfaceClass));
    }
}